package com.tencet.service.Impl;

import com.tencet.dao.OpenAccountDao;
import com.tencet.dao.impl.OpenAccountDaoImpl;
import com.tencet.entity.OpenAccount;
import com.tencet.service.OpenAccountService;
import com.tencet.utils.JDBCUtils;
import org.apache.commons.dbutils.DbUtils;

import java.sql.SQLException;

/**
 * @author Yangjx
 * @version 1.0.0
 * @ClassName OpenAccountServiceImpl.java
 * @Description TODO service 调 dao
 * @createTime 2022年07月20日 21:28
 */
public class OpenAccountServiceImpl implements OpenAccountService {

    private OpenAccountDao openAccountDao = new OpenAccountDaoImpl();

    @Override
    public boolean open(OpenAccount openAccount) {

        //调用OpenAccountDaoImpl中的updateAccount方法，返回影响行数
        int i = 0;
        try {
            i = openAccountDao.updateAccount(openAccount);
        } catch (SQLException e) {
            e.printStackTrace();
        }

        if (i > 0) {
            return true;
        }
        return false;
    }
}
